package 面向对象.多态;

public class Main {
    public static void main(String[] args) {
        People people1 = new Student();
        people1.喵喵喵();
        People people2 = new Teacher();
        people2.喵喵喵();
//        可以使用instanceof关键字来判断类型,避免强转出错
        if (people1 instanceof Student) {
            Student student = (Student) people1;
            student.喵喵喵();
        }
    }
}
